package cn.buk.tms.dto;

import cn.buk.tms.entity.misc.SmsDetail;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.beans.BeanUtils;

import java.util.Date;

/**
 * @author yfdai
 */
public class SmsDetailDto {

  private int id;

  private String recvPhoneNo;

  private String smsContent;

  /**
   * 类型 0/null： 下行 1: 上行
   */
  private Integer smsType;

  private String operator;

  /**
   * 短信的发送状态，是否已发送给接口；00-未发送，01-已发送
   */
  private String sendStatus;

  private String msgId;

  /**
   * 接口的发送状态，终端用户最终是否收到信息, 0表示用户收到信息
   */
  private String confirmStatus;

  //以下两项便于短信内容和业务订单关联
  /**
   * 订单号: 使用订单号来区分该短信属于哪个订单
   */
  private String orderNo;


  @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
  private Date createTime;

  @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
  private Date lastUpdate;

  public static SmsDetailDto createdBy(SmsDetail smsDetail) {
    SmsDetailDto dto = new SmsDetailDto();
    BeanUtils.copyProperties(smsDetail, dto);
    return dto;
  }


  public int getId() {
    return id;
  }


  public void setId(int id) {
    this.id = id;
  }


  public String getRecvPhoneNo() {
    return recvPhoneNo;
  }


  public void setRecvPhoneNo(String recvPhoneNo) {
    this.recvPhoneNo = recvPhoneNo;
  }


  public String getSmsContent() {
    return smsContent;
  }


  public void setSmsContent(String smsContent) {
    this.smsContent = smsContent;
  }


  public String getSendStatus() {
    return sendStatus;
  }


  public void setSendStatus(String sendStatus) {
    this.sendStatus = sendStatus;
  }


  public String getConfirmStatus() {
    return confirmStatus;
  }


  public void setConfirmStatus(String confirmStatus) {
    this.confirmStatus = confirmStatus;
  }


  public String getOperator() {
    return operator;
  }

  public void setOperator(String operator) {
    this.operator = operator;
  }

  public Date getCreateTime() {
    return createTime;
  }

  public void setCreateTime(Date createTime) {
    this.createTime = createTime;
  }

  public Date getLastUpdate() {
    return lastUpdate;
  }

  public void setLastUpdate(Date lastUpdate) {
    this.lastUpdate = lastUpdate;
  }

  public String getMsgId() {
    return msgId;
  }

  public void setMsgId(String msgId) {
    this.msgId = msgId;
  }

  public Integer getSmsType() {
    return smsType == null ? 0 : smsType;
  }

  public void setSmsType(int smsType) {
    this.smsType = smsType;
  }

  public String getOrderNo() {
    return orderNo;
  }

  public void setOrderNo(String orderNo) {
    this.orderNo = orderNo;
  }

}


